import Vue from "vue"; 
import App from "../App.vue";
import router from "../router";
import store from "../store";
import "@/assets/public.less";
import "@/common/permission";
import "@/common/vant";
import "@/common/validateInput";
import Navigation from "vue-navigation";
import bus from "@/common/bus";
import Vconsole from "vconsole";
import plugin from "@/common/plugin";
import commonRoutes from "../router/commonRouter";   
import reuseRouter from "../reuse-router";
export const mainfunction = (routes,hasComon=true) => {
  if (process.env.NODE_ENV === "production") {
    new Vconsole();
  }  
  //是否包含公共路由
  if(hasComon){ 
    router.addRoutes(commonRoutes);
  }

  router.addRoutes(routes);
  
  Vue.mixin(reuseRouter);
  Vue.use(Navigation, { router });
  Vue.use(plugin);

  Vue.config.productionTip = false;
  Vue.prototype.$bus = bus;
  new Vue({
    router,
    store,
    render: (h) => h(App),
  }).$mount("#app");
}; 
 